package com.ddwanglife.ml.second;

import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.rdd.RDD;
import org.apache.spark.sql.SparkSession;
import scala.Function1;
import scala.collection.TraversableOnce;

public class ReadHdfsDemo {
    public static void main(String[] args) {
        SparkSession spark = SparkSession.builder().master("local").appName("read hdfs dataset").getOrCreate();
        SparkContext sc = spark.sparkContext();
        RDD<String> stringRDD = sc.textFile("hdfs://192.168.208.50:9000/u01/bigdata/data/u.user", 2);
        /*SparkConf conf = new SparkConf().setAppName("read hdfs dataset").setMaster("local");
        JavaSparkContext sc = new JavaSparkContext(conf);
        JavaRDD<String> stringRDD = sc.textFile("hdfs://192.168.208.50:9000/u01/bigdata/data/u.user");*/

    }
}
